﻿using System.ServiceModel.Channels;
using System.ServiceModel.Dispatcher;
using Windows.Storage;

namespace ShopPowerTemplate
{
    public class CustomClientMessageInspector : IClientMessageInspector
    {
        public void AfterReceiveReply(ref System.ServiceModel.Channels.Message reply, object correlationState)
        {
        }

        public object BeforeSendRequest(ref System.ServiceModel.Channels.Message request, System.ServiceModel.IClientChannel channel)
        {
            request.Headers.Add(MessageHeader.CreateHeader("User", "http://www.icinetic.com", ApplicationData.Current.RoamingSettings.Values["User"]));
            request.Headers.Add(MessageHeader.CreateHeader("Pwd", "http://www.icinetic.com", ApplicationData.Current.RoamingSettings.Values["Password"]));

            return null;
        }
    }
}
